package com.danny.componentbase

import com.danny.componentbase.emptyservice.EmptyAccountService
import com.danny.componentbase.service.IAccountService

class ServiceFactory private constructor(){

    private var iAccountService: IAccountService? = null
        get() {
            if (field == null) {
                this.iAccountService = EmptyAccountService()
            }
            return field
        }

    companion object {
        val serviceFactory: ServiceFactory by lazy { ServiceFactory() }
    }

    fun setAccountService(iAccountService: IAccountService){
        this.iAccountService = iAccountService
    }

    fun getAccountService(): IAccountService {
        return iAccountService!!
    }



}